]> dgit.raspbian.org Git - gnome-shell.git/commit
st: Track stylesheet changes on the StThemeContext
authorCarlos Garnacho <carlosg@gnome.org>
Thu, 24 Oct 2019 12:03:12 +0000 (14:03 +0200)
committerFlorian Müllner <florian.muellner@gmail.com>
Tue, 5 Nov 2019 12:36:28 +0000 (12:36 +0000)
commit6a42d7726119c538d260e54cdbe2f31e5fbeb03c
tree508ba328cfb0c64ffb8027797390651e51e83b91
parent55867c40c4d35c85d9de9284b10aa86113e1efb5
st: Track stylesheet changes on the StThemeContext

Instead of every individual StThemeNode. There are essentially two kinds
of theme nodes: Those we create for lookups, and those interned by the
theme context and used by StWidgets. Listening to the signal on the former
is pointless as they are short lived and not meant to be really used for
drawing. So it is only essential to track stylesheet changes in those we
intern for later use.

This change does precisely that, it lets the StThemeContext track the
stylesheet changes and let all known theme nodes reset their state for
it.

The internal array holding all connected handlers for this signal in glib
was about the biggest single allocation made in gnome-shell, as interned
theme nodes nodes are around the 4 to 5 digit numbers. This essentially
makes it disappear.

This however means that widgets that are explicitly set a theme through
st_widget_set_theme() don't get their theme node implicitly updated.
There's little reasons to use that API, so perhaps this is an acceptable
tradeoff.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/779
src/st/st-theme-context.c
src/st/st-theme-node-private.h
src/st/st-theme-node.c